#ifndef DAILY_TRAVELLING_ALLOWANCE_TYPE_STRUCT_HH
#define DAILY_TRAVELLING_ALLOWANCE_TYPE_STRUCT_HH 1


#include <string>
#include <iostream>
#include <vector>
#include "otl8.hpp"

static const char*  daily_travelling_allowance_type_struct_s = "SELECT DAILYALLOWANCETYPEID, CODE, NOTES FROM DAILY_TRAVELLING_ALLOWANCE_TYPE_STRUCT";

static const char*  daily_travelling_allowance_type_struct_i = "INSERT INTO DAILY_TRAVELLING_ALLOWANCE_TYPE_STRUCT ( DAILYALLOWANCETYPEID, CODE, NOTES )VALUES(:f1<int>, :f2<char[128]>, :f3<char[128]>)";

static const char* daily_travelling_allowance_type_struct_c = "CREATE TABLE DAILY_TRAVELLING_ALLOWANCE_TYPE_STRUCT ( DAILYALLOWANCETYPEID INTEGER , CODE VARCHAR(128) , NOTES VARCHAR(128) )";
class daily_travelling_allowance_type_struct
{



public:
daily_travelling_allowance_type_struct():_dailyAllowanceTypeId(0), _code(""), _notes(""){_select=daily_travelling_allowance_type_struct_s;_insert=daily_travelling_allowance_type_struct_i;_create=daily_travelling_allowance_type_struct_c;}


daily_travelling_allowance_type_struct(int a__dailyAllowanceTypeId, std::string a__code, std::string a__notes):_dailyAllowanceTypeId(a__dailyAllowanceTypeId) , _code(a__code) , _notes(a__notes) {_select=daily_travelling_allowance_type_struct_s;_insert=daily_travelling_allowance_type_struct_i;_create=daily_travelling_allowance_type_struct_c;}


int dailyAllowanceTypeId(){return  _dailyAllowanceTypeId;}
void set_dailyAllowanceTypeId(int a__dailyAllowanceTypeId){ _dailyAllowanceTypeId = a__dailyAllowanceTypeId;}


std::string code(){return  _code;}
void set_code(std::string a__code){ _code = a__code;}


std::string notes(){return  _notes;}
void set_notes(std::string a__notes){ _notes = a__notes;}


daily_travelling_allowance_type_struct & operator=( const daily_travelling_allowance_type_struct & x)
{
	_dailyAllowanceTypeId =  x._dailyAllowanceTypeId;
	_code =  x._code;
	_notes =  x._notes;
	return *this;
}


bool operator==( const daily_travelling_allowance_type_struct & x)
{
	return 	_dailyAllowanceTypeId ==  x._dailyAllowanceTypeId &&
	_code ==  x._code &&
	_notes ==  x._notes;
}


friend std::istream& operator >> (std::istream& ist, daily_travelling_allowance_type_struct & t)
{
	if (!(ist >> t._dailyAllowanceTypeId)) return ist;
	if (!(ist >> t._code)) return ist;
	if (!(ist >> t._notes)) return ist;

	return ist;
}

friend std::ostream& operator << (std::ostream& ost, daily_travelling_allowance_type_struct & t)
{
	ost << t._dailyAllowanceTypeId << " ";
	ost << t._code << " ";
	ost << t._notes << " ";

	return ost;
}
/*
friend otl_stream& operator >> (otl_stream& ist, daily_travelling_allowance_type_struct & t)
{
	ist >> t._dailyAllowanceTypeId;
	ist >> t.buf; t._code=(const char*)t.buf;
	ist >> t.buf; t._notes=(const char*)t.buf;

	return ist;
}

friend otl_stream& operator << (otl_stream& ost, daily_travelling_allowance_type_struct & t)
{
	ost << t._dailyAllowanceTypeId ;
	ost << t._code.c_str() ;
	ost << t._notes.c_str() ;

	return ost;
}
*/
std::string select_stmt() { return _select; }
std::string insert_stmt() { return _insert; }
std::string create_stmt() { return _create; }


private:

	int	_dailyAllowanceTypeId;
	std::string	_code;
	std::string	_notes;
	std::string _create;
	std::string _select;
	std::string _insert;
char buf[128];
};
#endif
